package hh.leecode.华为机考;

import com.sun.xml.internal.ws.api.model.CheckedException;
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerTemplateAvailabilityProvider;
import org.springframework.cglib.core.Local;

import java.io.*;
import java.math.BigDecimal;
import java.sql.SQLOutput;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.stream.Stream;

public   class HWTest {

static int i = getValue();
protected static int i2 = 10;

static int getValue(){
    return i2;
}
    public static   void main(String[] args) throws RuntimeException{

    Stream.of("little","red","riding","hood").parallel()
            .map(s-> {
                System.out.println("map: " + s + " " + Thread.currentThread().getName());
                return s + "_";
            }).filter(s->{
        System.out.println("filter: " + s + " " + Thread.currentThread().getName());
        return s.length() > 3;
    }).reduce((s1,s2)->{
        System.out.println("reducer: " + s1 + " " + Thread.currentThread().getName());
        return s1.length() > s2.length() ? s1 : s2;
    });
    }

}
